/** Copyright (C) 2013  SPLN (sepalani)
    This file is part of Wii Relocator SP.

    Wii Relocator SP is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Wii Relocator SP is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Wii Relocator SP.  If not, see <http://www.gnu.org/licenses/>.
 */

package UI;

import Wii.PPC.PowerPC;
import Wii.Relocators.*;
import Wii.IO;
import java.io.*;

/**
 *
 * @author spln
 */
public class GuiB1 extends javax.swing.JFrame {

    /**
     * Creates new form GuiB1
     */
    public GuiB1() {
        initComponents();
        
        eUI = new easyUI();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jFrameToolsAddress = new javax.swing.JFrame();
        jLabelToolsAddressRoffset = new javax.swing.JLabel();
        jTextFieldToolsAddressRoffset = new javax.swing.JTextField();
        jLabelToolsAddressFrom = new javax.swing.JLabel();
        jComboBoxToolsAddressFrom = new javax.swing.JComboBox();
        jTextFieldToolsAddressFrom = new javax.swing.JTextField();
        jButtonToolsAddressGet = new javax.swing.JButton();
        jSeparatorToolsAddress1 = new javax.swing.JSeparator();
        jTextFieldToolsAddress = new javax.swing.JTextField();
        jComboBoxToolsAddress = new javax.swing.JComboBox();
        jButtonToolsAddressResolve = new javax.swing.JButton();
        jLabelToolsAddressDef = new javax.swing.JLabel();
        jLabelToolsAddress = new javax.swing.JLabel();
        jLabelToolsAddressExtract = new javax.swing.JLabel();
        jSeparatorToolsAddress2 = new javax.swing.JSeparator();
        jRadioButtonToolsAddressExtractBinary = new javax.swing.JRadioButton();
        jRadioButtonToolsAddressExtractObject = new javax.swing.JRadioButton();
        jButtonToolsAddressExtract = new javax.swing.JButton();
        buttonGroupToolsAddress = new javax.swing.ButtonGroup();
        jTabbedPaneMain = new javax.swing.JTabbedPane();
        jScrollPaneFile = new javax.swing.JScrollPane();
        jSplitPaneFile = new javax.swing.JSplitPane();
        jScrollPaneFileTree = new javax.swing.JScrollPane();
        jScrollPaneFileProperties = new javax.swing.JScrollPane();
        jLabelFileProperties = new javax.swing.JLabel();
        jScrollPaneRelocationTable = new javax.swing.JScrollPane();
        jTabbedPaneRelocationTable = new javax.swing.JTabbedPane();
        jScrollPaneRelocationTableTree = new javax.swing.JScrollPane();
        jSplitPaneFileRelocationTree = new javax.swing.JSplitPane();
        jScrollPaneRelocationTree = new javax.swing.JScrollPane();
        jScrollPaneRelocationProperties = new javax.swing.JScrollPane();
        jLabelRelocationProperties = new javax.swing.JLabel();
        jScrollPaneInternalsRelocation = new javax.swing.JScrollPane();
        jTableInternalsRelocation = new javax.swing.JTable();
        jScrollPaneExternalsRelocation = new javax.swing.JScrollPane();
        jTableExternalsRelocation = new javax.swing.JTable();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenuFile = new javax.swing.JMenu();
        jMenuFileNew = new javax.swing.JMenu();
        jMenuItemFileNewRel = new javax.swing.JMenuItem();
        jMenuItemFileNewRso = new javax.swing.JMenuItem();
        jMenuItemFileNewSel = new javax.swing.JMenuItem();
        jSeparatorFile1 = new javax.swing.JPopupMenu.Separator();
        jMenuItemFileOpen = new javax.swing.JMenuItem();
        jMenuItemFileOpenAs = new javax.swing.JMenuItem();
        jSeparatorFile2 = new javax.swing.JPopupMenu.Separator();
        jMenuItemFileDump = new javax.swing.JMenuItem();
        jMenuItemFileSave = new javax.swing.JMenuItem();
        jMenuItemFileSaveAs = new javax.swing.JMenuItem();
        jSeparatorFile3 = new javax.swing.JPopupMenu.Separator();
        jMenuItemFileQuit = new javax.swing.JMenuItem();
        jMenuTools = new javax.swing.JMenu();
        jMenuItemToolsExtractBinary = new javax.swing.JMenuItem();
        jMenuItemToolsExtractObject = new javax.swing.JMenuItem();
        jMenuItemToolsResolveAddress = new javax.swing.JMenuItem();
        jMenuQ = new javax.swing.JMenu();
        jMenuItemQHelp = new javax.swing.JMenuItem();
        jMenuItemQAbout = new javax.swing.JMenuItem();

        jFrameToolsAddress.setTitle("Resolve address");

        jLabelToolsAddressRoffset.setText("r_offset:  ");

        jTextFieldToolsAddressRoffset.setText("Enter r_offset...");

        jLabelToolsAddressFrom.setText("From:  ");

        jComboBoxToolsAddressFrom.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "File", "MEM1", "MEM2", "Custom...", " " }));
        jComboBoxToolsAddressFrom.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jComboBoxToolsAddressFromActionPerformed(evt);
            }
        });

        jTextFieldToolsAddressFrom.setText("address");
        jTextFieldToolsAddressFrom.setEnabled(false);

        jButtonToolsAddressGet.setText("Get relocated address");
        jButtonToolsAddressGet.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonToolsAddressGetActionPerformed(evt);
            }
        });

        jTextFieldToolsAddress.setText("Enter relocated address...");

        jComboBoxToolsAddress.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "R_PPC_NONE (0x00)", "R_PPC_ADDR32  (0x01)", "*R_PPC_ADDR24  (0x02)", "R_PPC_ADDR16  (0x03)", "R_PPC_ADDR16_LO (0x04)", "R_PPC_ADDR16_HI  (0x05)", "R_PPC_ADDR16_HA (0x06)", "*R_PPC_ADDR14  (0x07)", "*R_PPC_ADDR14  (0x08)", "*R_PPC_ADDR14  (0x09)", "R_PPC_REL24 (0x0A)", "*R_PPC_REL14 (0x0B)", "*R_PPC_REL14 (0x0C)", "*R_PPC_REL14 (0x0D)" }));
        jComboBoxToolsAddress.setToolTipText("");

        jButtonToolsAddressResolve.setText("Resolve");
        jButtonToolsAddressResolve.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonToolsAddressResolveActionPerformed(evt);
            }
        });

        jLabelToolsAddressDef.setText("*:  not supported relocation");

        jLabelToolsAddress.setText("Address:  0xXXXXXXXX");

        jLabelToolsAddressExtract.setText("Extract :");

        buttonGroupToolsAddress.add(jRadioButtonToolsAddressExtractBinary);
        jRadioButtonToolsAddressExtractBinary.setSelected(true);
        jRadioButtonToolsAddressExtractBinary.setText("Binary");

        buttonGroupToolsAddress.add(jRadioButtonToolsAddressExtractObject);
        jRadioButtonToolsAddressExtractObject.setText("Object");

        jButtonToolsAddressExtract.setText("Extract");
        jButtonToolsAddressExtract.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonToolsAddressExtractActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jFrameToolsAddressLayout = new javax.swing.GroupLayout(jFrameToolsAddress.getContentPane());
        jFrameToolsAddress.getContentPane().setLayout(jFrameToolsAddressLayout);
        jFrameToolsAddressLayout.setHorizontalGroup(
            jFrameToolsAddressLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSeparatorToolsAddress2)
            .addComponent(jSeparatorToolsAddress1)
            .addGroup(jFrameToolsAddressLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jFrameToolsAddressLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jFrameToolsAddressLayout.createSequentialGroup()
                        .addComponent(jLabelToolsAddressRoffset)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextFieldToolsAddressRoffset))
                    .addComponent(jButtonToolsAddressGet, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButtonToolsAddressExtract, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jTextFieldToolsAddress)
                    .addComponent(jComboBoxToolsAddress, 0, 280, Short.MAX_VALUE)
                    .addComponent(jButtonToolsAddressResolve, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabelToolsAddress, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jFrameToolsAddressLayout.createSequentialGroup()
                        .addGroup(jFrameToolsAddressLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jFrameToolsAddressLayout.createSequentialGroup()
                                .addComponent(jLabelToolsAddressExtract)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jRadioButtonToolsAddressExtractBinary)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jRadioButtonToolsAddressExtractObject))
                            .addComponent(jLabelToolsAddressDef))
                        .addGap(0, 55, Short.MAX_VALUE))
                    .addGroup(jFrameToolsAddressLayout.createSequentialGroup()
                        .addComponent(jLabelToolsAddressFrom)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jComboBoxToolsAddressFrom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextFieldToolsAddressFrom)))
                .addContainerGap())
        );
        jFrameToolsAddressLayout.setVerticalGroup(
            jFrameToolsAddressLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jFrameToolsAddressLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jFrameToolsAddressLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelToolsAddressRoffset)
                    .addComponent(jTextFieldToolsAddressRoffset, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jFrameToolsAddressLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelToolsAddressFrom)
                    .addComponent(jComboBoxToolsAddressFrom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldToolsAddressFrom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonToolsAddressGet)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparatorToolsAddress1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextFieldToolsAddress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jComboBoxToolsAddress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonToolsAddressResolve)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabelToolsAddressDef)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabelToolsAddress)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jSeparatorToolsAddress2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jFrameToolsAddressLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelToolsAddressExtract)
                    .addComponent(jRadioButtonToolsAddressExtractBinary)
                    .addComponent(jRadioButtonToolsAddressExtractObject))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonToolsAddressExtract)
                .addContainerGap())
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Wii Relocator SP");

        jSplitPaneFile.setDividerLocation(240);
        jSplitPaneFile.setLeftComponent(jScrollPaneFileTree);

        jLabelFileProperties.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jLabelFileProperties.setText("<Properties>");
        jLabelFileProperties.setToolTipText("");
        jLabelFileProperties.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        jScrollPaneFileProperties.setViewportView(jLabelFileProperties);

        jSplitPaneFile.setRightComponent(jScrollPaneFileProperties);

        jScrollPaneFile.setViewportView(jSplitPaneFile);

        jTabbedPaneMain.addTab("Tree View", jScrollPaneFile);

        jScrollPaneRelocationTable.setPreferredSize(new java.awt.Dimension(106, 22));

        jTabbedPaneRelocationTable.setPreferredSize(new java.awt.Dimension(484, 182));

        jSplitPaneFileRelocationTree.setDividerLocation(240);
        jSplitPaneFileRelocationTree.setLeftComponent(jScrollPaneRelocationTree);

        jLabelRelocationProperties.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jLabelRelocationProperties.setText("<Properties>");
        jLabelRelocationProperties.setToolTipText("");
        jLabelRelocationProperties.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        jScrollPaneRelocationProperties.setViewportView(jLabelRelocationProperties);

        jSplitPaneFileRelocationTree.setRightComponent(jScrollPaneRelocationProperties);

        jScrollPaneRelocationTableTree.setViewportView(jSplitPaneFileRelocationTree);

        jTabbedPaneRelocationTable.addTab("Tree", jScrollPaneRelocationTableTree);

        jTableInternalsRelocation.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "r_offset", "r_info", "r_addend"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPaneInternalsRelocation.setViewportView(jTableInternalsRelocation);

        jTabbedPaneRelocationTable.addTab("Internals", jScrollPaneInternalsRelocation);

        jTableExternalsRelocation.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "r_offset", "r_info", "r_addend"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPaneExternalsRelocation.setViewportView(jTableExternalsRelocation);

        jTabbedPaneRelocationTable.addTab("Externals", jScrollPaneExternalsRelocation);

        jScrollPaneRelocationTable.setViewportView(jTabbedPaneRelocationTable);

        jTabbedPaneMain.addTab("Relocation Table", jScrollPaneRelocationTable);

        jMenuFile.setText("File");

        jMenuFileNew.setText("New");
        jMenuFileNew.setEnabled(false);

        jMenuItemFileNewRel.setText("REL file");
        jMenuItemFileNewRel.setEnabled(false);
        jMenuItemFileNewRel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemFileNewRelActionPerformed(evt);
            }
        });
        jMenuFileNew.add(jMenuItemFileNewRel);

        jMenuItemFileNewRso.setText("RSO file");
        jMenuItemFileNewRso.setEnabled(false);
        jMenuItemFileNewRso.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemFileNewRsoActionPerformed(evt);
            }
        });
        jMenuFileNew.add(jMenuItemFileNewRso);

        jMenuItemFileNewSel.setText("SEL file");
        jMenuItemFileNewSel.setEnabled(false);
        jMenuItemFileNewSel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemFileNewSelActionPerformed(evt);
            }
        });
        jMenuFileNew.add(jMenuItemFileNewSel);

        jMenuFile.add(jMenuFileNew);
        jMenuFile.add(jSeparatorFile1);

        jMenuItemFileOpen.setText("Open");
        jMenuItemFileOpen.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemFileOpenActionPerformed(evt);
            }
        });
        jMenuFile.add(jMenuItemFileOpen);

        jMenuItemFileOpenAs.setText("Open as...");
        jMenuItemFileOpenAs.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemFileOpenAsActionPerformed(evt);
            }
        });
        jMenuFile.add(jMenuItemFileOpenAs);
        jMenuFile.add(jSeparatorFile2);

        jMenuItemFileDump.setText("Dump");
        jMenuItemFileDump.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemFileDumpActionPerformed(evt);
            }
        });
        jMenuFile.add(jMenuItemFileDump);

        jMenuItemFileSave.setText("Save");
        jMenuItemFileSave.setEnabled(false);
        jMenuItemFileSave.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemFileSaveActionPerformed(evt);
            }
        });
        jMenuFile.add(jMenuItemFileSave);

        jMenuItemFileSaveAs.setText("Save as...");
        jMenuItemFileSaveAs.setEnabled(false);
        jMenuItemFileSaveAs.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemFileSaveAsActionPerformed(evt);
            }
        });
        jMenuFile.add(jMenuItemFileSaveAs);
        jMenuFile.add(jSeparatorFile3);

        jMenuItemFileQuit.setText("Quit");
        jMenuItemFileQuit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemFileQuitActionPerformed(evt);
            }
        });
        jMenuFile.add(jMenuItemFileQuit);

        jMenuBar1.add(jMenuFile);

        jMenuTools.setText("Tools");

        jMenuItemToolsExtractBinary.setText("Extract Binary from...");
        jMenuItemToolsExtractBinary.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemToolsExtractBinaryActionPerformed(evt);
            }
        });
        jMenuTools.add(jMenuItemToolsExtractBinary);

        jMenuItemToolsExtractObject.setText("Extract Object from...");
        jMenuItemToolsExtractObject.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemToolsExtractObjectActionPerformed(evt);
            }
        });
        jMenuTools.add(jMenuItemToolsExtractObject);

        jMenuItemToolsResolveAddress.setText("Resolve address...");
        jMenuItemToolsResolveAddress.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemToolsResolveAddressActionPerformed(evt);
            }
        });
        jMenuTools.add(jMenuItemToolsResolveAddress);

        jMenuBar1.add(jMenuTools);

        jMenuQ.setText("?");

        jMenuItemQHelp.setText("Help");
        jMenuItemQHelp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemQHelpActionPerformed(evt);
            }
        });
        jMenuQ.add(jMenuItemQHelp);

        jMenuItemQAbout.setText("About");
        jMenuItemQAbout.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItemQAboutActionPerformed(evt);
            }
        });
        jMenuQ.add(jMenuItemQAbout);

        jMenuBar1.add(jMenuQ);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPaneMain, javax.swing.GroupLayout.DEFAULT_SIZE, 510, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPaneMain, javax.swing.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
    
    // Button Events 
    
    // Menu Events
    
    //<editor-fold defaultstate="collapsed" desc="[GUI] File > New              - Items Event">
    private void jMenuItemFileNewRelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemFileNewRelActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItemFileNewRelActionPerformed

    private void jMenuItemFileNewRsoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemFileNewRsoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItemFileNewRsoActionPerformed

    private void jMenuItemFileNewSelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemFileNewSelActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItemFileNewSelActionPerformed
    //</editor-fold>
    
    //<editor-fold defaultstate="collapsed" desc="[GUI] File > Open             - Items Event">
    private void jMenuItemFileOpenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemFileOpenActionPerformed
        // TODO add your handling code here:
        String[] desc = new String[] {"RSO files", "REL Files"};
        String[] filter = new String[] {".rso", ".rel"};
        File f = eUI.getOpenFilename(desc, filter);
        if (f == null || !f.exists()) { 
            eUI.messageBoxExt(this, "File doesn't exist!", "Failed to open file", easyUI.MBIcon_ERROR);
            return;
        } 
        
        //--- Loading RSO file
        relFile = new RSO(f);
        // relOffset = 0; relDec = 0;
        relFile.load(relOffset, relDec);
        isLoaded = true;
        
        // Load Tree View (Sections, Imports, Exports)
        jScrollPaneFileTree.setViewportView(fileTree = new FileTree(relFile));
        fileTree.properties = jLabelFileProperties;
        fileTree.addTreeSelectionListener(fileTree);
        fileTree.addMouseListener(fileTree);
        
        // Load Relocation Tree View (Sections, Imports, Exports)
        jScrollPaneRelocationTree.setViewportView(relocationTree = new RelocationTree(relFile));
        relocationTree.properties = jLabelRelocationProperties;
        relocationTree.addTreeSelectionListener(relocationTree);
        relocationTree.addMouseListener(relocationTree);
        
        // Load Internals Relocation Table
        javax.swing.table.DefaultTableModel modelIrt = (javax.swing.table.DefaultTableModel) jTableInternalsRelocation.getModel();
        modelIrt.setRowCount(0);
        irt = relFile.relocation[0];
        for (int i = 0; i < irt.r_offset.length; i++) {
            modelIrt.addRow(new String[] { "0x"         + irt.r_offset[i],
                                           "(0x0000"    + irt.r_info[1][i] + "," + irt.r_info[2][i] + ")",
                                           "0x"         + irt.r_addend[i] });
        }
        modelIrt.fireTableDataChanged();
        
        // Load Externals Relocation Table
        javax.swing.table.DefaultTableModel modelErt = (javax.swing.table.DefaultTableModel) jTableExternalsRelocation.getModel();
        modelErt.setRowCount(0);
        ert = relFile.relocation[1];
        for (int i = 0; i < ert.r_offset.length; i++) {
            modelErt.addRow(new String[] { "0x"         + ert.r_offset[i],
                                           "(0x0000"    + ert.r_info[1][i] + "," + ert.r_info[2][i] + ")",
                                           "0x"         + ert.r_addend[i] });
        }
        modelErt.fireTableDataChanged();
        
    }//GEN-LAST:event_jMenuItemFileOpenActionPerformed

    private void jMenuItemFileOpenAsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemFileOpenAsActionPerformed
        // TODO add your handling code here:
        String nb1 = eUI.getStringExt(this, "Enter RSO offset:", "Input", easyUI.MBIcon_QUESTION);
        String nb2 = eUI.getStringExt(this, "Addresses rectification:", "Input", easyUI.MBIcon_QUESTION);
        Long offset, dec;
        
        //--- Get input
        try {
            offset = easyUI.parseLong(nb1);
            dec    = easyUI.parseLong(nb2);
        } catch (NumberFormatException | NullPointerException e){
            eUI.messageBoxExt(this, "Isn't a valide number!", "Input error", easyUI.MBIcon_ERROR);
            e.printStackTrace();
            return;
        }
        
        //--- Load RSO
        relOffset = offset; relDec = dec;
        jMenuItemFileOpenActionPerformed(evt);
        relOffset = 0; relDec = 0;
    }//GEN-LAST:event_jMenuItemFileOpenAsActionPerformed
    //</editor-fold>
    
    //<editor-fold defaultstate="collapsed" desc="[GUI] File > Save             - Items Event">
    private void jMenuItemFileDumpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemFileDumpActionPerformed
        // TODO add your handling code here:
        if (!isLoaded) {
            eUI.messageBoxExt(this, "File isn't loaded!", "Failed to dump file", easyUI.MBIcon_ERROR);
            return;
        }
        
        //--- Get File
        File out = eUI.getSaveFilename(new String[] {"Text file"}, new String[] {".txt"});
        if (out == null) {
            eUI.messageBoxExt(this, "File error!", "Failed to save file", easyUI.MBIcon_ERROR);
            return;
        } else if (out.exists()) {
            eUI.messageBoxExt(this, "File already exists!", "Failed to save file", easyUI.MBIcon_INFORMATION);
            return;
        }
        
        //--- Dump
        FileWriter fw;
        BufferedWriter bw;
        try {
            fw = new FileWriter(out);
            bw = new BufferedWriter(fw);
            bw.write(relFile.dump());
            bw.close();
            fw.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
        eUI.messageBoxExt(this, "Data dumped successfuly!", "Done", easyUI.MBIcon_INFORMATION);
    }//GEN-LAST:event_jMenuItemFileDumpActionPerformed

    private void jMenuItemFileSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemFileSaveActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItemFileSaveActionPerformed

    private void jMenuItemFileSaveAsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemFileSaveAsActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMenuItemFileSaveAsActionPerformed
    //</editor-fold>
    
    //<editor-fold defaultstate="collapsed" desc="[GUI] File > System           - Items Event">
    private void jMenuItemFileQuitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemFileQuitActionPerformed
        // TODO add your handling code here:
        System.exit(0);
    }//GEN-LAST:event_jMenuItemFileQuitActionPerformed
    //</editor-fold>
    
    //<editor-fold defaultstate="collapsed" desc="[GUI] ? > Help/About          - Items Event">
    private void jMenuItemQHelpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemQHelpActionPerformed
        // TODO add help file
        eUI.messageBox(this,"Real men don't need help!");
    }//GEN-LAST:event_jMenuItemQHelpActionPerformed

    private void jMenuItemQAboutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemQAboutActionPerformed
        eUI.messageBox(this,String.format(
                            "    Wii Relocator SP v0.3 %n %n"+
                            "    Copyright © 2013  SPLN (sepalani) %n"+
                            "    This program is free software: you can redistribute it and/or modify%n" +
                            "    it under the terms of the GNU General Public License as published by%n" +
                            "    the Free Software Foundation, either version 3 of the License, or%n" +
                            "    (at your option) any later version.%n" +
                            "%n" +
                            "    This program is distributed in the hope that it will be useful,%n" +
                            "    but WITHOUT ANY WARRANTY; without even the implied warranty of%n" +
                            "    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%n" +
                            "    GNU General Public License for more details.%n" +
                            "%n" +
                            "    You should have received a copy of the GNU General Public License%n" +
                            "    along with this program.  If not, see <http://www.gnu.org/licenses/>."));
    }//GEN-LAST:event_jMenuItemQAboutActionPerformed
    //</editor-fold>    
    
    //<editor-fold defaultstate="collapsed" desc="[GUI] Tools > Extract from    - Items Event">
    private void jMenuItemToolsExtractBinaryActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemToolsExtractBinaryActionPerformed
        // TODO add your handling code here:
        if (!isLoaded) {
            eUI.messageBoxExt(this, "File isn't loaded!", "Failed to extract binary", easyUI.MBIcon_ERROR);
            return;
        }
        String nb1 = eUI.getStringExt(this, "Enter binary offset:", "Input", easyUI.MBIcon_INFORMATION);
        Long offset;
        
        //--- Get input
        try {
            offset = easyUI.parseLong(nb1);
        } catch (NumberFormatException e){
            eUI.messageBoxExt(this, "Isn't a valide number!", "Input error", easyUI.MBIcon_ERROR);
            e.printStackTrace();
            return;
        }
        
        //--- Get filename
        File out = eUI.getSaveFilename(new String[] {"Binary file"}, new String[] {".bin"});
        if (out == null) {
            eUI.messageBoxExt(this, "File error!", "Failed to save file", easyUI.MBIcon_ERROR);
            return;
        } else if (out.exists()) {
            eUI.messageBoxExt(this, "File already exists!", "Failed to save file", easyUI.MBIcon_INFORMATION);
            return;
        }
        
        //--- Get binary
        FileOutputStream fos;
        BufferedOutputStream bos;
        try {
            int[] buff = PowerPC.extractBinary(relFile.fileLocation, offset);
            fos = new FileOutputStream(out);
            bos = new BufferedOutputStream(fos);
            
            for (int i = 0; i < buff.length; i++) {
                bos.write(buff[i]);
            }
            bos.close();
            fos.close();
        } catch (IOException e) {
            e.printStackTrace();
            return;
        }
        eUI.messageBoxExt(this, "Binary extracted successfuly!", "Done", easyUI.MBIcon_INFORMATION);
    }//GEN-LAST:event_jMenuItemToolsExtractBinaryActionPerformed

    private void jMenuItemToolsExtractObjectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemToolsExtractObjectActionPerformed
        // TODO add your handling code here:
        if (!isLoaded) {
            eUI.messageBoxExt(this, "File isn't loaded!", "Failed to extract object", easyUI.MBIcon_ERROR);
            return;
        }
        String nb1 = eUI.getStringExt(this, "Enter binary offset:", "Input", easyUI.MBIcon_INFORMATION);
        Long offset;
        
        //--- Get input
        try {
            offset = easyUI.parseLong(nb1);
        } catch (NumberFormatException e){
            eUI.messageBoxExt(this, "Isn't a valide number!", "Input error", easyUI.MBIcon_ERROR);
            e.printStackTrace();
            return;
        }
        
        //--- Get filename
        File out = eUI.getSaveFilename(new String[] {"Binary file"}, new String[] {".bin"});
        if (out == null) {
            eUI.messageBoxExt(this, "File error!", "Failed to save file", easyUI.MBIcon_ERROR);
            return;
        } else if (out.exists()) {
            eUI.messageBoxExt(this, "File already exists!", "Failed to save file", easyUI.MBIcon_INFORMATION);
            return;
        }
        
        //--- Get binary
        FileOutputStream fos;
        BufferedOutputStream bos;
        try {
            int[] buff = PowerPC.extractObject(relFile.fileLocation, offset);
            fos = new FileOutputStream(out);
            bos = new BufferedOutputStream(fos);
            
            for (int i = 0; i < buff.length; i++) {
                bos.write(buff[i]);
            }
            bos.close();
            fos.close();
        } catch (IOException e) {
            e.printStackTrace();
            return;
        }
        eUI.messageBoxExt(this, "Object extracted successfuly!", "Done", easyUI.MBIcon_INFORMATION);
    }//GEN-LAST:event_jMenuItemToolsExtractObjectActionPerformed

    private void jMenuItemToolsResolveAddressActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemToolsResolveAddressActionPerformed
        // TODO add your handling code here:
        jFrameToolsAddress.setVisible(true);
        jFrameToolsAddress.setSize(305, 350);
    }//GEN-LAST:event_jMenuItemToolsResolveAddressActionPerformed
    //</editor-fold>
    
    private void jButtonToolsAddressResolveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonToolsAddressResolveActionPerformed
        // TODO add your handling code here:
        int index = jComboBoxToolsAddress.getSelectedIndex();
        long r_offset = -1, symb = -1;
        try {
            r_offset = easyUI.parseLong(jTextFieldToolsAddressRoffset.getText());
            symb = easyUI.parseLong(jTextFieldToolsAddress.getText());
        } catch (NumberFormatException e) {
            easyUI.messageBoxExt(this, "Invalid r_offset/symbol address!", "Failed to resolve address", easyUI.MBIcon_ERROR);
            e.printStackTrace();
        }
        
        long add = PowerPC.resolveAddress(symb, index, r_offset);
        if (add < 0) {
            jLabelToolsAddress.setText(String.format("Address:  0xERROR", add));
        } else if (add == 0x04) {
            jLabelToolsAddress.setText(String.format("Address:  0x____%04X", add));
        } else if (add == 0x05 || add == 0x06) {
            jLabelToolsAddress.setText(String.format("Address:  0x%04X____", add));
        } else {
            jLabelToolsAddress.setText(String.format("Address:  0x%08X", add));
        }
    }//GEN-LAST:event_jButtonToolsAddressResolveActionPerformed

    private void jButtonToolsAddressGetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonToolsAddressGetActionPerformed
        // TODO add your handling code here:
        if (!isLoaded) {
            eUI.messageBoxExt(this, "File isn't loaded!", "Failed to read address", easyUI.MBIcon_ERROR);
            return;
        }
        
        long from, offset;
        try {
            from    = 0;
            offset  = easyUI.parseLong(jTextFieldToolsAddressRoffset.getText());
            
            switch (jComboBoxToolsAddressFrom.getSelectedIndex()) {
                case 1:     // MEM1
                    from = PowerPC.MEM1_OFFSET;
                    break;
                case 2:     // MEM2
                    from = PowerPC.MEM2_OFFSET;
                    break;
                case 3:     // Custom
                    from = easyUI.parseLong(jTextFieldToolsAddressFrom.getText());
                    break;
                default:    // File  
                    break;
            }
            
            offset = PowerPC.getRelocatedAddressFrom(offset, relFile.fileLocation, from);
            jTextFieldToolsAddress.setText(String.format("0x%08X", offset));
            
        } catch (NumberFormatException e) {
            easyUI.messageBoxExt(this, "Isn't a valide number!", "Input error", easyUI.MBIcon_ERROR);
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }//GEN-LAST:event_jButtonToolsAddressGetActionPerformed

    private void jComboBoxToolsAddressFromActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxToolsAddressFromActionPerformed
        // TODO add your handling code here:
        if (jComboBoxToolsAddressFrom.getSelectedIndex() == 3) {
            jTextFieldToolsAddressFrom.setEnabled(true);
        } else {
            jTextFieldToolsAddressFrom.setEnabled(false);
        }
    }//GEN-LAST:event_jComboBoxToolsAddressFromActionPerformed

    private void jButtonToolsAddressExtractActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonToolsAddressExtractActionPerformed
        //  Address rectification
        long address = 0;
        switch (jComboBoxToolsAddressFrom.getSelectedIndex()) {
            case 1:     // MEM1
                address -= PowerPC.MEM1_OFFSET;
                break;
            case 2:     // MEM2
                address -= PowerPC.MEM2_OFFSET;
                break;
            case 3:     // Custom
                address -= easyUI.parseLong(jTextFieldToolsAddressFrom.getText());
                break;
        default:    // File  
                break;
        }
        
        //  Get Address
        try {
            address += easyUI.parseLong(jLabelToolsAddress.getText().substring(8));
        } catch (NumberFormatException e) {
            easyUI.messageBoxExt(this, "Isn't a valide address!", "Input error", easyUI.MBIcon_ERROR);
            e.printStackTrace();
            return;
        }
        
        //--- Get filename
        File out = eUI.getSaveFilename(new String[] {"Binary file"}, new String[] {".bin"});
        if (out == null) {
            eUI.messageBoxExt(this, "File error!", "Failed to save file", easyUI.MBIcon_ERROR);
            return;
        } else if (out.exists()) {
            eUI.messageBoxExt(this, "File already exists!", "Failed to save file", easyUI.MBIcon_INFORMATION);
            return;
        }
        
        //--- Get binary/object
        FileOutputStream fos;
        BufferedOutputStream bos;
        try {
            int[] buff;
            if (jRadioButtonToolsAddressExtractObject.isSelected()) {
                buff = PowerPC.extractObject(relFile.fileLocation, address);
            } else {
                buff = PowerPC.extractBinary(relFile.fileLocation, address);
            }
            fos = new FileOutputStream(out);
            bos = new BufferedOutputStream(fos);
            
            for (int i = 0; i < buff.length; i++) {
                bos.write(buff[i]);
            }
            bos.close();
            fos.close();
        } catch (IOException e) {
            e.printStackTrace();
            return;
        }
        eUI.messageBoxExt(this, "Data extracted successfuly!", "Done", easyUI.MBIcon_INFORMATION);
    }//GEN-LAST:event_jButtonToolsAddressExtractActionPerformed
    
    
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(GuiB1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                new GuiB1().setVisible(true);
            }
        });
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroupToolsAddress;
    private javax.swing.JButton jButtonToolsAddressExtract;
    private javax.swing.JButton jButtonToolsAddressGet;
    private javax.swing.JButton jButtonToolsAddressResolve;
    private javax.swing.JComboBox jComboBoxToolsAddress;
    private javax.swing.JComboBox jComboBoxToolsAddressFrom;
    private javax.swing.JFrame jFrameToolsAddress;
    private javax.swing.JLabel jLabelFileProperties;
    private javax.swing.JLabel jLabelRelocationProperties;
    private javax.swing.JLabel jLabelToolsAddress;
    private javax.swing.JLabel jLabelToolsAddressDef;
    private javax.swing.JLabel jLabelToolsAddressExtract;
    private javax.swing.JLabel jLabelToolsAddressFrom;
    private javax.swing.JLabel jLabelToolsAddressRoffset;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenu jMenuFile;
    private javax.swing.JMenu jMenuFileNew;
    private javax.swing.JMenuItem jMenuItemFileDump;
    private javax.swing.JMenuItem jMenuItemFileNewRel;
    private javax.swing.JMenuItem jMenuItemFileNewRso;
    private javax.swing.JMenuItem jMenuItemFileNewSel;
    private javax.swing.JMenuItem jMenuItemFileOpen;
    private javax.swing.JMenuItem jMenuItemFileOpenAs;
    private javax.swing.JMenuItem jMenuItemFileQuit;
    private javax.swing.JMenuItem jMenuItemFileSave;
    private javax.swing.JMenuItem jMenuItemFileSaveAs;
    private javax.swing.JMenuItem jMenuItemQAbout;
    private javax.swing.JMenuItem jMenuItemQHelp;
    private javax.swing.JMenuItem jMenuItemToolsExtractBinary;
    private javax.swing.JMenuItem jMenuItemToolsExtractObject;
    private javax.swing.JMenuItem jMenuItemToolsResolveAddress;
    private javax.swing.JMenu jMenuQ;
    private javax.swing.JMenu jMenuTools;
    private javax.swing.JRadioButton jRadioButtonToolsAddressExtractBinary;
    private javax.swing.JRadioButton jRadioButtonToolsAddressExtractObject;
    private javax.swing.JScrollPane jScrollPaneExternalsRelocation;
    private javax.swing.JScrollPane jScrollPaneFile;
    private javax.swing.JScrollPane jScrollPaneFileProperties;
    private javax.swing.JScrollPane jScrollPaneFileTree;
    private javax.swing.JScrollPane jScrollPaneInternalsRelocation;
    private javax.swing.JScrollPane jScrollPaneRelocationProperties;
    private javax.swing.JScrollPane jScrollPaneRelocationTable;
    private javax.swing.JScrollPane jScrollPaneRelocationTableTree;
    private javax.swing.JScrollPane jScrollPaneRelocationTree;
    private javax.swing.JPopupMenu.Separator jSeparatorFile1;
    private javax.swing.JPopupMenu.Separator jSeparatorFile2;
    private javax.swing.JPopupMenu.Separator jSeparatorFile3;
    private javax.swing.JSeparator jSeparatorToolsAddress1;
    private javax.swing.JSeparator jSeparatorToolsAddress2;
    private javax.swing.JSplitPane jSplitPaneFile;
    private javax.swing.JSplitPane jSplitPaneFileRelocationTree;
    private javax.swing.JTabbedPane jTabbedPaneMain;
    private javax.swing.JTabbedPane jTabbedPaneRelocationTable;
    private javax.swing.JTable jTableExternalsRelocation;
    private javax.swing.JTable jTableInternalsRelocation;
    private javax.swing.JTextField jTextFieldToolsAddress;
    private javax.swing.JTextField jTextFieldToolsAddressFrom;
    private javax.swing.JTextField jTextFieldToolsAddressRoffset;
    // End of variables declaration//GEN-END:variables
    // Variables declaration
    private easyUI          eUI;
    private FileTree        fileTree;
    private RelocationTree  relocationTree;
    private boolean         isLoaded;
    private RSO             relFile;
    private long            relOffset;
    private long            relDec;
    private RelocationTable irt, ert;

}


